import 'package:animal/constant/color.dart';
import 'package:animal/constant/font.dart';
import 'package:animal/utils/screen_util.dart';
import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

///消息列表item
class MessageListItem extends StatelessWidget {
  const MessageListItem({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: ScreenUtil().L(16)),
      child: Row(
        children: [
          GFAvatar(
            size: ScreenUtil().L(35),
            backgroundImage: const NetworkImage("https://cdn.pixabay.com/photo/2016/11/22/07/09/spruce-1848543__340.jpg"),
            shape: GFAvatarShape.standard,
          ),
          Expanded(
            child: Container(
              margin: EdgeInsets.only(left: ScreenUtil().L(10),top: ScreenUtil().L(10)),
              padding: EdgeInsets.symmetric(vertical: ScreenUtil().L(12)),
              decoration: BoxDecoration(border: Border(bottom: BorderSide(width: ScreenUtil().L(0.7), color: const Color(0XFFF2F2F2)))),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text("小王同学", style: KFontConstant.myTextStyle(size: 16)),
                      Container(height: ScreenUtil().L(8)),
                      Text(
                        "置顶了，固定在顶部按最近消息时间排列",
                        style: KFontConstant.myTextStyle(size: 12, color: const Color(0XFF91949B)),
                        overflow: TextOverflow.ellipsis,
                      ),
                    ],
                  ),
                  Container(
                      margin: EdgeInsets.only(right: ScreenUtil().L(10)),
                      child: Text("15:33", style: KFontConstant.myTextStyle(size: 10, color: const Color(0XFFBEC0CA)))),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
